<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录</title>

<script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>

<style type="text/css">
.title {
	font-family: verdana, tahoma, sans-serif;
	FONT-SIZE: 10px;
	font-weight: bold
}

.grey {
	FONT-SIZE: 12px;
	color: #666666
}

.orange {
	font-family: verdana, tahoma, sans-serif;
	font-size: 10px;
	color: #FF6600
}

.orange A:link {
	font-family: verdana, tahoma, sans-serif;
	font-size: 10px;
	color: #FF6600;
	text-decoration: underline
}

.orange A:visited {
	font-family: verdana, tahoma, sans-serif;
	font-size: 10px;
	color: #FF6600;
	text-decoration: underline
}

.orange A:hover {
	font-family: verdana, tahoma, sans-serif;
	font-size: 10px;
	color: #FF6600;
	text-decoration: underline
}

.orange A:active {
	font-family: verdana, tahoma, sans-serif;
	font-size: 10px;
	color: #FF6600;
	text-decoration: underline
}

textarea,input,select {
	background: #FFFFFF;
	border: 1px solid #CCCCCC;
	color: #000000;
	font-family: verdana, tahoma, sans-serif;
	font-size: 0.95em;
}

.username {
	background-image: url(../images/login/username.gif);
	background-position: 1px 1px;
	background-repeat: no-repeat;
	padding-left: 20px;
	height: 20px;
	FONT-SIZE: 12px;
}

.password {
	background-image: url(../images/login/password.gif);
	background-position: 1px 1px;
	background-repeat: no-repeat;
	padding-left: 20px;
	height: 20px;
	FONT-SIZE: 12px;
}

#zhezhao {
  background-color:#000000;
  height:100%;
  left:0;
  opacity:0.3;
  position:fixed;
  top:0;
  width:100%;
  z-index:999;
}
</style>

<script type="text/javascript">
	function login() {
		var accountId = $("#accountId").val();
		var password = $("#password").val();
	//	$("#zhezhao").css("display","block");  
		$.ajax({
			url : "../user/login.do",
			type : "POST",
			data : {
				accountId : accountId, 
				password : password
			},
			timeout : 5000,
			dataType : "json",
			success : function(data) {
				if(data.errorCode == 'SUCCESS'){
					//$(".zhezhao").css("display","none");  
					location.reload();
					return;
				}else{
					alert('用户名或密码错误.');
					return;
				}
			},
			error : function() {
				alert('登录失败，请重新尝试');
			}
		});
	}
</script>

<c:if test="${sessionScope.employees != null}">
	<c:redirect url="index.jsp" />
</c:if>

</head>

<body>
		<div id="zhezhao" style="display: none;"></div>
	<table id="loginTable" width="208" border="0" align="center" cellpadding="5"
		cellspacing="0">
		<tr>
			<td bgcolor="#F4F4F4" class="title">+ LOGIN</td>
		</tr>
		<tr>
			<td class="grey"><img src="../images/login/warning.gif" width="16"
				height="16" align="absmiddle"> 请输入登陆的用户和密码</td>
		</tr>
		<tr>
			<td class="title">使用工号或用户名</td>
		</tr>
		<tr>
			<td><input id="accountId" type="text" class="username"
				size="30"></td>
		</tr>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td class="title">密码</td>
		</tr>
		<tr>
			<td><input id="password" type="password" class="password"
				size="30"></td>
		</tr>
		<tr>
			<td class="orange"><a href="#">Get your Password ? </a></td>
		</tr>
		<tr>
			<td align="right"><img src="../images/login/loginin.gif" width="70"
				height="21" onclick="login();"></td>
		</tr>
	</table>
	<p>&nbsp;</p>
	<br>
	<hr>
	<p align="center">
		<font color=black>站尾说明 <a href="http://www.xxx.cn"
			target="_blank">xxxx</a> 联系方式
		</font>
	</p>
	<br>
</body>
</html>